/*
 * Sesame Inc.
 * Copyright (c) 2009 All Rights Reserved.
 */
package com.sesame.service;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;

import com.sesame.domain.Album;
import com.sesame.domain.AlbumTag;
import com.sesame.domain.Comment;
import com.sesame.domain.Image;
import com.sesame.domain.ImageTag;
import com.sesame.domain.TagCloud;
import com.sesame.toolkit.Page;

/**
 * @author voidman
 * 
 */
@Transactional
public interface AlbumService {
    public boolean isNewAlbum(Album album, Map model);

    @Transactional(readOnly = true)
    public List<Album> listAllAlbum(Page page);

    @Transactional(readOnly = true)
    public List<Album> listAllAlbum(Integer userId);

    @Transactional(readOnly = true)
    public List<Album> listAllAlbum();

    public boolean isEditAlbum(Album album, Map model);

    public Album showAlbum(Integer albumId);

    public void deleteAlbum(Integer albumId);

    @Transactional(readOnly = true)
    public List<AlbumTag> listAlbumTag(Integer albumId);

    public void newAlbumTag(Integer albumId, String tag, Map model);

    public void deleteAlbumTag(Integer albumTagId);

    @Transactional(readOnly = true)
    public List<Image> listImage(Integer albumId);

    @Transactional(readOnly = true)
    public List<Image> listAllImage();

    public Image showImage(Integer imageId);

    public boolean isEditImage(Image image, Map model);

    @Transactional(readOnly = true)
    public List<Comment> listComment(Integer imageId);

    public void newImage(Image image, Map model);

    public void newComment(Integer imageId, Integer userId, String nickName,
            String content, String headPic);

    public void deleteComment(Integer id);

    @Transactional(readOnly = true)
    public List<ImageTag> listImageTag(Integer imageId);

    public void newImageTag(Integer imageId, String tag, Map model);

    public void deleteImageTag(Integer imageTagId);

    public void updateCover(Album album);

    @Transactional(readOnly = true)
    public Integer getAlbumCount(Integer userId);

    @Transactional(readOnly = true)
    public Integer getAllAlbumCount();

    @Transactional(readOnly = true)
    public List<Image> listTopImage(Integer userId);

    @Transactional(readOnly = true)
    public List<Image> listAllImage(Integer userId);

    @Transactional(readOnly = true)
    public List<Image> listTopImage();

    @Transactional(readOnly = true)
    public List<Album> listTopAlbumByUserId(Integer userId);

    @Transactional(readOnly = true)
    public List<Album> listTopAlbum();

    public void deleteImage(Integer id);

    @Transactional(readOnly = true)
    public List<TagCloud> listAllAlbumTag();

    @Transactional(readOnly = true)
    public List<TagCloud> listAllImageTag();

    @Transactional(readOnly = true)
    public List<Album> searchAlbumTag(String tag);

    @Transactional(readOnly = true)
    public List<Album> listPageAlbum(Page page);

    @Transactional(readOnly = true)
    public List<Image> listImage(Page page);

    @Transactional(readOnly = true)
    public Integer getImageCount(Integer albumId);

    @Transactional(readOnly = true)
    public Integer getAllImageCount();

    @Transactional(readOnly = true)
    public Integer getUserImageCount(Integer userId);

    @Transactional(readOnly = true)
    public List<Image> listPageImage(Page page);

    @Transactional(readOnly = true)
    public List<Image> listUserImage(Page page);
}